package com.kayt.cyberBar.cpublic.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kayt.cyberBar.common.PageData;
import com.kayt.cyberBar.common.ServerResponse;
import com.kayt.cyberBar.cpublic.business.entity.po.CPublicReqType;
import com.kayt.cyberBar.cpublic.business.entity.req.vo.PublicReqTypeReqVO;
import com.kayt.cyberBar.cpublic.business.entity.rsp.vo.PublicReqTypeRspVO;
import com.kayt.cyberBar.cpublic.business.server.IPublicReqTypeServer;
import com.kayt.cyberBar.cpublic.business.service.IPublicReqTypeService;

@Service("publicReqTypeService")
public class PublicReqTypeServiceImpl implements IPublicReqTypeService{
	@Autowired
	private IPublicReqTypeServer publicReqTypeServer;
	@Override
	public ServerResponse<PageData<PublicReqTypeRspVO>> getReqTypeList() {
		PageData<CPublicReqType> reqTypePageData = publicReqTypeServer.get_reqType_list();
		return publicReqTypeServer.assemble_result_list(reqTypePageData);
	}

	@Override
	public ServerResponse<PublicReqTypeRspVO> addReqType(PublicReqTypeReqVO reqTypeReqVO) {
		CPublicReqType reqType = publicReqTypeServer.add_reqType(reqTypeReqVO);
		return publicReqTypeServer.assemble_result(reqType);
	}

	@Override
	public ServerResponse<PublicReqTypeRspVO> updateReqType(PublicReqTypeReqVO reqTypeReqVO) {
		CPublicReqType reqType = publicReqTypeServer.mod_reqType(reqTypeReqVO);
		return publicReqTypeServer.assemble_result(reqType);
	}

	@Override
	public ServerResponse<String> deleteReqType(String reqTypeId) {
		Integer result = publicReqTypeServer.del_reqType(reqTypeId);
		return publicReqTypeServer.assemble_result_string(result);
	}
}
